<%-- 
    Document   : produtoCad
    Created on : 06/06/2011, 13:30:12
    Author     : pauloferreira
--%>

<%@page contentType="text/html;charset=UTF-8" language="java"%>
<%@page isELIgnored="false"%>
<%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<f:loadBundle basename="Adkiraki.mensagens" var="msg"/>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"    
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>ADKIRAKI©</title>
    <script language="JavaScript" src="../JS/Adkiraki.js"></script>
    <link href="${pageContext.request.contextPath}/Pages/CSS/Adkiraki.css" type="text/css" rel="STYLESHEET"></link>    
</head>
<body>
<f:view>
<h:form id="produtocad">        
    <table>
	<!-- Cabeçalho -->
        <tr>
            <td colspan="4" class="header">
            </td>
        </tr>
        <!-- Menu -->
        <tr>
            <td class="menufake">
            </td>
            <td class="menu">
                <h:outputLink value="/Pages/View/home.jsf"><h:outputText value="Início" styleClass="submenu"/></h:outputLink>                                
            </td>
            <td class="menu">
                <h:outputLink value="/Pages/View/produtos.jsf"><h:outputText value="Produtos" styleClass="submenu"/></h:outputLink>                
            </td>
            <td class="menu">
                <h:outputLink value="/Pages/View/contatos.jsf"><h:outputText value="Contatos" styleClass="submenu"/></h:outputLink>                                                
            </td>
        </tr>
    </table>
    <table>        
        <tr id="principal">
            <td style="width:250px;white-space: nowrap;" valign="top">
            </td>
            <td style="width:500px;" valign="top">
                <fieldset>
                    <legend>Cadastro de Produtos</legend>                   
                    <h:outputText value="Categoria:" styleClass="label"/><br>                    
                    <h:selectOneMenu id="categoria" value="#{produtoBean.categoriaId}" required="true" requiredMessage="Preencher o campo Categoria." styleClass="edit" style="width:65%">
                        <f:selectItem itemValue="" itemLabel="Selecione..."/>
                        <f:selectItems value="#{categoriaBean.listCategoria}"/>  
                    </h:selectOneMenu>                    
                    <h:outputLink value="/Pages/View/categoriaCad.jsf">&nbsp&nbsp<h:outputText value="Nova Categoria" styleClass="button"/></h:outputLink><br>                    
                    <br>
                    <h:outputText value="Nome Produto:" styleClass="label"/><br>                    
                    <h:inputText id="nome" value="#{produtoBean.nome}" required="true" requiredMessage="Preencher o campo Nome." styleClass="edit" maxlength="60" style="width:95%"/><br>
                    <h:outputText value="Descrição:" styleClass="label"/><br>
                    <h:inputTextarea id="descricao" value="#{produtoBean.descricao}" required="true" requiredMessage="Preencher o campo Descrição." styleClass="edit" cols="90" rows="15" style="overflow:scroll"/><br>
                    <h:outputText value="Valor(R$):" styleClass="label"/><br>
                    <h:inputText id="valor" value="#{produtoBean.valor}" required="true" requiredMessage="Preencher o campo Valor." styleClass="edit" maxlength="10"/><br>
                    <br>
                    <hr>
                    <h:commandButton id="salvar" value="#{msg.btn_salvar}" type="submit" styleClass="button" style="width:20%" action="#{produtoBean.Salvar}"/>
                    <h:commandButton id="limpar" value="#{msg.btn_limpar}" type="reset" styleClass="button" style="width:20%"/>
                </fieldset>
                <br>
                <p>
                    <h:messages styleClass="messages_erro"/>
                </p>                         
            </td>
        </tr>
    </table>
</h:form>
</f:view>                
</body>
</html>
